package com.yongoe.ecy.secondNode.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yongoe.ecy.secondNode.entity.SecondNode;
import com.yongoe.ecy.secondNode.mapper.SecondNodeMapper;
import com.yongoe.ecy.secondNode.service.SecondNodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 二级节点
 *
 * @author monad
 * @since 2024/03/10
 */
@Service
public class SecondNodeServiceImpl extends ServiceImpl<SecondNodeMapper, SecondNode> implements SecondNodeService {

    @Override
    public Page<SecondNode> getSecondNodeByPage(Page<SecondNode> page, SecondNode secondNode) {
       return baseMapper.getSecondNodeByPage(page, secondNode);
    }

    // 新增二级节点
    @Override
    public Long addSecondNode(SecondNode secondNode) {
        return baseMapper.addSecondNode(secondNode);
    }

    // 修改二级节点
    @Override
    public void updateSecondNode(SecondNode secondNode) {
        baseMapper.updateSecondNode(secondNode);
    }

    // 删除二级节点(neo4j)
    @Override
    public void deleteSecondNodes(Long[] ids) {
        baseMapper.deleteSecondNodes(ids);
    }

    // 删除二级节点(mysql)
    @Override
    public void deleteByIds(Long[] ids) {
        baseMapper.deleteByIds(ids);
    }

    // 删除全部二级节点(mysql)
    @Override
    public void removeAll() {
        baseMapper.removeAll();
    }

    // 查询子节点
    @Override
    public int selectChild(Long[] ids) {
        return baseMapper.selectChild(ids);
    }

}
